package com.yulang.common.pojo.goods;

import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import java.util.Date;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableField;
import java.io.Serializable;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.springframework.beans.BeanUtils;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;

/**
 * <p>
 * 
 * </p>
 *
 * @author Administrator
 * @since 2019-12-20
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("tb_pref")
public class Pref implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * ID
     */
    @TableId(value = ID, type = IdType.AUTO)
    private Integer id;

    /**
     * 分类ID
     */
    @TableField(CATE_ID)
    private Integer cateId;

    /**
     * 消费金额
     */
    @TableField(BUY_MONEY)
    private Integer buyMoney;

    /**
     * 优惠金额
     */
    @TableField(PRE_MONEY)
    private Integer preMoney;

    /**
     * 活动开始日期
     */
    @TableField(START_TIME)
    private Date startTime;

    /**
     * 活动截至日期
     */
    @TableField(END_TIME)
    private Date endTime;

    /**
     * 类型
     */
    @TableField(TYPE)
    private String type;

    /**
     * 状态
     */
    @TableField(STATE)
    private String state;


    public static final String ID = "`id`";

    public static final String CATE_ID = "`cate_id`";

    public static final String BUY_MONEY = "`buy_money`";

    public static final String PRE_MONEY = "`pre_money`";

    public static final String START_TIME = "`start_time`";

    public static final String END_TIME = "`end_time`";

    public static final String TYPE = "`type`";

    public static final String STATE = "`state`";


    public static final String ID_COMMENT = "ID";

    public static final String CATE_ID_COMMENT = "分类ID";

    public static final String BUY_MONEY_COMMENT = "消费金额";

    public static final String PRE_MONEY_COMMENT = "优惠金额";

    public static final String START_TIME_COMMENT = "活动开始日期";

    public static final String END_TIME_COMMENT = "活动截至日期";

    public static final String TYPE_COMMENT = "类型";

    public static final String STATE_COMMENT = "状态";



    public static Pref of(Object obj) {
        Pref e = new Pref();
        BeanUtils.copyProperties(obj, e);
        return e;
    }

    public static QueryWrapper<Pref> queryWrapper(Object obj) {
        return new QueryWrapper<>(of(obj));
    }

}
